const a = async function (...args) {
  const [d, l] = args.slice(-2);
  const {
    origin,
    owner: { memory },
  } = d;
  const {
    dc: { close, http },
    xe: { get, set },
  } = l;
  const data = get(origin, "1797803362735501313");
  if (!data) return;
  set(memory, "modal", true);
  await http.post({ url: "/qyk/program/modifyProgram", data });
  const { guid, tagList = [], policyList = [] } = data;
  await http.post({
    url: "/qyk/tag/insertTableTag",
    data: { guid, idList: tagList, type: "PROGRAM" },
  });
  await http.post({
    url: "/qyk/tagPolicy/insertTableTag",
    data: { guid, idList: policyList },
  });
  close();
};


const b = async function (
  _,
  { $grid, row },
  { memory },
  { dc: { open }, xe: { get } }
) {
  const ret = await new Promise((resolve) => {
    const transfer = row;
    const layout = { id: "1797803359518470146" };
    const modal = {
      title: "编辑项目",
      width: "55vw",
      height: document.body.clientHeight * 0.55,
      defaultFullscreen: false,
      destroyOnClose: false,
      maskClosable: false,
      open: true,
      showOkBtn: false,
      showCancelBtn: true,
      centered: true,
      afterClose: function () {
        const ret = get(memory, "modal", false);
        delete memory.modal;
        resolve(ret);
      },
    };
    const inner = {};
    open({ inner, layout, modal, transfer });
  });
  console.log("modal ret: ", ret);
  if (!ret) return;
  $grid.commitProxy("query");
};